

using System;
using System.Collections.Generic;
using System.Text;
using EntityLayer;
using System.Data;
using DataAccessLayer;

namespace DataLayer
{
	public class datCategoriesContents
	{
		public datCategoriesContents()
		{
		}
		
		#region  Code Factory Generated Methods
		public void DeleteCategoriesContentsByCategoryContentId(entCategoriesContents parEntCategoriesContents, DbConnector parDbConnector)
		{
			DbParamCollection insDbParamCollection = new DbParamCollection();
			insDbParamCollection.Add("@pCategoryContentId",parEntCategoriesContents.CategoryContentId);
			parDbConnector.ExecuteNonQuery("DeleteCategoriesContentsByCategoryContentId",insDbParamCollection);
		}
		public void InsertCategoriesContents(entCategoriesContents parEntCategoriesContents, DbConnector parDbConnector)
		{
			DbParamCollection insDbParamCollection = new DbParamCollection();
			insDbParamCollection.Add("@pCategoryId",parEntCategoriesContents.CategoryId);
			insDbParamCollection.Add("@pCategoryName",parEntCategoriesContents.CategoryName);
			insDbParamCollection.Add("@pLanguageId",parEntCategoriesContents.LanguageId);
			insDbParamCollection.AddOutput("@pCategoryContentId",DbType.Int32);
			parDbConnector.ExecuteNonQuery("InsertCategoriesContents",insDbParamCollection);
			parEntCategoriesContents.CategoryContentId = Convert.ToInt32(insDbParamCollection.GetOutPutParameter().Value);
		}
		public void UpdateCategoriesContentsByCategoryContentId(entCategoriesContents parEntCategoriesContents, DbConnector parDbConnector)
		{
			DbParamCollection insDbParamCollection = new DbParamCollection();
			insDbParamCollection.Add("@pCategoryContentId",parEntCategoriesContents.CategoryContentId);
			
			insDbParamCollection.Add("@pCategoryId",parEntCategoriesContents.CategoryId);
			insDbParamCollection.Add("@pCategoryName",parEntCategoriesContents.CategoryName);
			insDbParamCollection.Add("@pLanguageId",parEntCategoriesContents.LanguageId);
			parDbConnector.ExecuteNonQuery("UpdateCategoriesContentsByCategoryContentId",insDbParamCollection);
		}
		#endregion
        public void DeleteCategoriesContentsByCategoryId(entCategoriesContents parEntCategoriesContents, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pCategoryId", parEntCategoriesContents.CategoryId);
            parDbConnector.ExecuteNonQuery("DeleteCategoriesContentsByCategoryId", insDbParamCollection);
        }
        public DataTable SelectCategoriesContentsByCategoryId(entCategoriesContents parEntCategoriesContents, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pCategoryId", parEntCategoriesContents.CategoryId);
            return parDbConnector.ExecuteDataTable("SelectCategoriesContentsByCategoryId", insDbParamCollection);
        }
	}
}